//
//  MTRecomdAppViewController.m
//  ShiShiBang
//
//  Created by loujianwei on 16/9/25.
//  Copyright © 2016年 motianjituan. All rights reserved.
//

#import "MTRecomdAppViewController.h"
#import "MTRecomdAppCell.h"
#import "MTRecomdAppItem.h"

static NSString  * const ID = @"cell";
@implementation MTRecomdAppViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设置导航栏
    [self initNavigation];
    self.tableView.rowHeight = 100;

    //设置底部视图
    self.tableView.tableFooterView = [[UIView alloc] init];
}

#pragma mark -设置导航栏
-(void)initNavigation {
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"back"] highImage:[UIImage imageNamed:@"back anxia"] target:self action:@selector(backClick)];

    self.navigationItem.title = @"推荐应用";
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageWithColor:UIColorFromRGB(0x45c75a)]  forBarMetrics:UIBarMetricsDefault];
    NSMutableDictionary *attr = [NSMutableDictionary dictionary];
    attr[NSFontAttributeName] = [UIFont boldSystemFontOfSize:17];
    attr[NSForegroundColorAttributeName] = [UIColor whiteColor];
    [self.navigationController.navigationBar setTitleTextAttributes:attr];

    //注册cell
    [self.tableView registerClass:[MTRecomdAppCell class] forCellReuseIdentifier:ID];
}

#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 1;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {


    MTRecomdAppCell *cell = [tableView dequeueReusableCellWithIdentifier:ID forIndexPath:indexPath];

    return cell;
}


//返回按钮点击
- (void)backClick {
    [self.navigationController popViewControllerAnimated:YES];
}

@end
